from django.urls import path

from apis.base_data.views import ProjectViewSet, ProjectUpdateLogViewSet, ProjectWarnViewSet, ProjectImportViewSet, \
    GroupCustomerInfoViewSet, GroupInformationStatisticSet, MobileUserRecordViewSet, SpecialLineManagementViewSet, \
    InformationPlatformRecordViewSet, BusinessOpportunityRecordViewSet, ArrearsInformationRecordViewSet, \
    ArrearsInformationRecordImportViewSet, ArrearsImportStatusView, BatchDeptUpdateView
from utils.routers import CustomRouter

system_url = CustomRouter()
system_url.register(r'project', ProjectViewSet)
system_url.register(r'project_update_log', ProjectUpdateLogViewSet)
system_url.register(r'project_warn', ProjectWarnViewSet)
system_url.register(r'group_customer_info', GroupCustomerInfoViewSet)
system_url.register(r'group_customer_statistic', GroupInformationStatisticSet)
system_url.register(r'mobile_user_record', MobileUserRecordViewSet)
system_url.register(r'special-line-management', SpecialLineManagementViewSet)
system_url.register(r'information-platform-record', InformationPlatformRecordViewSet)
system_url.register(r'business-opportunity-record', BusinessOpportunityRecordViewSet)
system_url.register(r'arrears-information-record', ArrearsInformationRecordViewSet)

urlpatterns = [
    path(r'project/cont/', ProjectViewSet.as_view({'get': 'count'})),
    path(r'project/dept_count/', ProjectViewSet.as_view({'get': 'dept_count'})),
    path(r'project/creator_count/', ProjectViewSet.as_view({'get': 'creator_count'})),
    path(r'project/finish/', ProjectViewSet.as_view({'post': 'finish'})),
    path(r'project/import/', ProjectImportViewSet.as_view()),
    path(r'group_customer_statistic/group_detail/', GroupInformationStatisticSet.as_view({'get': 'group_detail'})),
    path(r'group_customer_info/group_detail/',
         GroupCustomerInfoViewSet.as_view({'get': 'group_detail'})),
    path(r'group_customer_info/check_test/',
         GroupCustomerInfoViewSet.as_view({'get': 'check_test'})),
    path(r'arrears-information-record/import/', ArrearsInformationRecordImportViewSet.as_view()),
    path(r'arrears-information-record/import-status/', ArrearsImportStatusView.as_view()),
    path(r'group_customer_statistic/import-update/', BatchDeptUpdateView.as_view())

]

urlpatterns += system_url.urls
